linux/x86: Advertise which page table entries contain MFNs and hence
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 20 Feb 2007 12:18:29 +0000 (12:18 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 20 Feb 2007 12:18:29 +0000 (12:18 +0000)
need to be (un)canonicalized during save/restore.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
linux-2.6-xen-sparse/arch/i386/kernel/Makefile
linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S
linux-2.6-xen-sparse/arch/x86_64/kernel/Makefile
linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S
patches/linux-2.6.18/x86-elfnote-as-preprocessor-macro.patch
xen/include/public/elfnote.h

index 843f3d2ceb781be7f42403acb87a46b663fb52b5..03d31c50981134ff7722d7518bef037c784aa477 100644 (file)
@@ -98,4 +98,5 @@ n-obj-xen := i8259.o timers/ reboot.o smpboot.o trampoline.o
 obj-y := $(call filterxen, $(obj-y), $(n-obj-xen))
 obj-y := $(call cherrypickxen, $(obj-y))
 extra-y := $(call cherrypickxen, $(extra-y))
+%/head-xen.o %/head-xen.s: EXTRA_AFLAGS :=
 endif
index 1582ded1aa4e9c7a58e107d77d414f90f2f4afd9..d788f323aeab5a5ca86c4b990abe79bc292ac4d4 100644 (file)
@@ -12,6 +12,8 @@
 #include <xen/interface/xen.h>
 #include <xen/interface/elfnote.h>
 
+#define _PAGE_PRESENT 0x1
+
 /*
  * References to members of the new_cpu_data structure.
  */
@@ -198,7 +200,9 @@ ENTRY(cpu_gdt_table)
        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
 #ifdef CONFIG_X86_PAE
        ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
+       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  _PAGE_PRESENT,_PAGE_PRESENT)
 #else
        ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "no")
+       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .long,  _PAGE_PRESENT,_PAGE_PRESENT)
 #endif
        ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
index f5b837d3534256bf655ea52519c9804cdc16fdd4..ae36f842a42f582f236d02bc021ff9337c863a50 100644 (file)
@@ -72,4 +72,5 @@ include $(srctree)/scripts/Makefile.xen
 obj-y := $(call filterxen, $(obj-y), $(n-obj-xen))
 obj-y := $(call cherrypickxen, $(obj-y))
 extra-y := $(call cherrypickxen, $(extra-y))
+%/head-xen.o %/head-xen.s: EXTRA_AFLAGS :=
 endif
index 64add5835361b8b0dabfd86f61c6dff5b696d360..b7ef0cbcb06850ea34350ad71f104c0c293607f2 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <xen/interface/elfnote.h>
 
+#define _PAGE_PRESENT 0x1
+
        .section .bootstrap.text, "ax", @progbits
        .code64
 #define VIRT_ENTRY_OFFSET 0x0
@@ -49,7 +51,7 @@ ENTRY(_stext)
 #define NEXT_PAGE(name) \
        $page = $page + 1; \
        .org $page * 0x1000; \
-       phys_/**/name = $page * 0x1000 + __PHYSICAL_START; \
+       phys_##name = $page * 0x1000 + __PHYSICAL_START; \
 ENTRY(name)
 
 NEXT_PAGE(init_level4_pgt)
@@ -181,5 +183,6 @@ ENTRY(empty_zero_page)
 #endif /* !CONFIG_XEN_COMPAT_030002 */
        ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad,  startup_64)
        ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad,  hypercall_page)
+       ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  _PAGE_PRESENT,_PAGE_PRESENT)
        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
        ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
index 79054fc19103100dd55fafdc44ced33c177ed0b8..9989d78297917afe856ff11ecbfd8b0bb9ee2c9b 100644 (file)
@@ -1,7 +1,7 @@
 diff -pruN ../orig-linux-2.6.18/include/linux/elfnote.h ./include/linux/elfnote.h
 --- ../orig-linux-2.6.18/include/linux/elfnote.h       2007-01-12 18:19:44.000000000 +0000
 +++ ./include/linux/elfnote.h  2007-01-12 18:21:02.000000000 +0000
-@@ -31,22 +31,24 @@
+@@ -31,22 +31,38 @@
  /*
   * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
   * turn out to be the same size and shape), followed by the name and
@@ -25,9 +25,21 @@ diff -pruN ../orig-linux-2.6.18/include/linux/elfnote.h ./include/linux/elfnote.
 -2:.align 4
 -3:\desc
 -4:.align 4
--.popsection
++#ifdef __STDC__
++#define ELFNOTE(name, type, desctype, descdata...) \
++.pushsection .note.name                       ;       \
++  .align 4                            ;       \
++  .long 2f - 1f               /* namesz */    ;       \
++  .long 4f - 3f               /* descsz */    ;       \
++  .long type                          ;       \
++1:.asciz #name                                ;       \
++2:.align 4                            ;       \
++3:desctype descdata                   ;       \
++4:.align 4                            ;       \
+ .popsection
 -.endm
-+#define ELFNOTE(name, type, desctype, descdata)       \
++#else /* !__STDC__, i.e. -traditional */
++#define ELFNOTE(name, type, desctype, descdata) \
 +.pushsection .note.name                       ;       \
 +  .align 4                            ;       \
 +  .long 2f - 1f               /* namesz */    ;       \
@@ -37,7 +49,8 @@ diff -pruN ../orig-linux-2.6.18/include/linux/elfnote.h ./include/linux/elfnote.
 +2:.align 4                            ;       \
 +3:desctype descdata                   ;       \
 +4:.align 4                            ;       \
-+.popsection                           ;
++.popsection
++#endif /* __STDC__ */
  #else /* !__ASSEMBLER__ */
  #include <linux/elf.h>
  /*
index 76bbf4fab8583f3bc67f03e536f7a7b65e41c4ff..e7738ab7f73423bd6a9177a3f0ba5467f3f2e6bf 100644 (file)
  */
 #define XEN_ELFNOTE_HV_START_LOW  12
 
+/*
+ * List of maddr_t-sized mask/value pairs describing how to recognize
+ * (non-present) L1 page table entries carrying valid MFNs (numeric).
+ */
+#define XEN_ELFNOTE_L1_MFN_VALID  13
+
 /*
  * System information exported through crash notes.
  *